package com.it.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PageController {
	/** 通用的页面跳转方法
	 * 例如:访问路径为 "/index"，则方法最后返回的值为："index"
	 * 即最终返回 /WEB-INF/pages/index.jsp
	 */
	@RequestMapping("/{page}")
	public String page(@PathVariable String page){
		return page;
	}

	@RequestMapping("/cl/{folder}/{page}")
	public String pageCl(@PathVariable String folder, @PathVariable String page){
		return "/cl/" + folder + "/" + page;
	}

	@RequestMapping("/sys/{folder}/{page}")
	public String pageSys(@PathVariable String folder, @PathVariable String page){
		return "/sys/" + folder + "/" + page;
	}

	@RequestMapping("/test/{folder}/{page}")
	public String pageTest(@PathVariable String folder, @PathVariable String page){
		return "/test/" + folder + "/" + page;
	}

	@RequestMapping("/resources/{page}")
	public String resources(@PathVariable String page){
		return "/resources/" + page;
	}

}